-
-
Notifications
You must be signed in to change notification settings - Fork 5k
WIP: Optimized matcher #3707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Optimized matcher #3707
Conversation
1) error handling async component errors Message: Expected spy warn to have been called once. It was called 0 times. Stack: Error: Expected spy warn to have been called once. It was called 0 times. at /home/iurisilvio/code/oss/vue-router/test/unit/specs/error-handling.spec.js:157:30 at <anonymous> at processTicksAndRejections (internal/process/task_queues.js:95:5)
✔️ Deploy Preview for vue-router-docs-v3 canceled. 🔨 Explore the source changes: 7b4b084 🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-router-docs-v3/deploys/61f6f32903b198000767f58d |
It is handled as dynamic route.
This reverts commit bc46fa8.
I did a small benchmark script to prove the concept, in my own machine. https://gist.github.com/iurisilvio/a916ce2de16336ec97aab8db5525f7f9 For 100 static routes, current vue-router takes 14ms average to resolve and my version takes less than 1ms. Even to resolve the first result, it is 30% slower because it evaluates one regex. |
For dynamic paths, it will evaluate only part of the routes, based on first level path. If you have 100 rules but only 5 starting with the same first level path, it will evaluate at most 5 rules. |
This is a draft implementation with some new ideas.
Regex match is 10x slower than simple object access. I still have to run some dynamic matches to not break ordering compatibility.
I still want to integrate it better with current code, I did this implementation to validate the issue and run some benchmarks.